home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
CCDBMS.ZIP
/
THREAD.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-03-17
|
4KB
|
101 lines
// =================================================================
// Thread.cpp
// =================================================================
// Harold Kasperink / John Dekker
// Dr. Dobb's Journal 1997
// =================================================================
// The function bodies in this files are empty because we cannot
// give the thread class implementation for copyright reasons and
// because it is beyond the scope of our article.
// What you could do is write here your own Pthread wrapper
// implememtation.
// =================================================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include "thread.h"
static int m_nThread = 0;
////////////////////////////////////////////////////////////////////
// ThreadFunc
////////////////////////////////////////////////////////////////////
// pThread = pointer to thread class which created the thread
//
// When a thread is created, the pointer to this function is passed
// as an argument, meaning that the trhead will jump to this function.
// The virtual class function Process is then called immediately
////////////////////////////////////////////////////////////////////
void ThreadFunc(CThread *pThread)
{
}
////////////////////////////////////////////////////////////////////
// CThread::CThread
////////////////////////////////////////////////////////////////////
// Constructor for thread
////////////////////////////////////////////////////////////////////
CThread::CThread()
{
}
////////////////////////////////////////////////////////////////////
// CThread::~CThread
////////////////////////////////////////////////////////////////////
// Destructor for thread object
////////////////////////////////////////////////////////////////////
CThread::~CThread()
{
}
////////////////////////////////////////////////////////////////////
// CThread::Process
////////////////////////////////////////////////////////////////////
// Dummy Function for creating the process thread loop in the
// derived class
////////////////////////////////////////////////////////////////////
void CThread::Process()
{
}
////////////////////////////////////////////////////////////////////
// CThread::Cancel
////////////////////////////////////////////////////////////////////
// Stop the thread created in this object
////////////////////////////////////////////////////////////////////
void CThread::Cancel()
{
}
////////////////////////////////////////////////////////////////////
// CThread::Create
////////////////////////////////////////////////////////////////////
// Create a thread, which will jumps to the pure virtal function
// Process of the derived class
////////////////////////////////////////////////////////////////////
void CThread::Create()
{
}
////////////////////////////////////////////////////////////////////
// CThread::Detach
////////////////////////////////////////////////////////////////////
// Frees the thread memory
////////////////////////////////////////////////////////////////////
void CThread::Detach()
{
}
////////////////////////////////////////////////////////////////////
// CThread::Join
////////////////////////////////////////////////////////////////////
// Let the main loop wait until the thread finishes
////////////////////////////////////////////////////////////////////
void CThread::Join()
{
}